#ifndef _RETRO_PLAYER_TEXTURE
#define _RETRO_PLAYER_TEXTURE

#include "player.graphic.h"

namespace Retro
{
  namespace Player
  {
    namespace Graphic
    {
      class Texture : public IGraphic
      {
      private:
        Display::Texture* mTexture;

      public:
        INL Display::Texture* getTexture()
        {
          return mTexture;
        }

        INL VOID  setTexture(Display::Texture* iValue)
        {
          if (mTexture)
            mTexture->unref();

          if (mTexture = iValue)
            mTexture->ref();
        }

        INL UINT  getWidth()
        {
          return mTexture ? mTexture->getWidth() : 0;
        }

        INL UINT  getHeight()
        {
          return mTexture ? mTexture->getHeight() : 0;
        }

        Texture();

        VOID init(Display::DisplayDevice* iDevice);
        VOID uninit(Display::DisplayDevice* iDevice);
        VOID render(
          Display::DisplayDevice* iDevice,
          const Geom::Bounds& iDest,
          const Geom::Bounds& iSource,
          COLOR iColor
        );
      };
    }
  }
}

#endif
